package org.weasel.base;

import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
import org.weasel.controllers.ApplicationController;
import org.weasel.views.DeveloperView;
import org.weasel.views.Navigator;
import org.weasel.views.Welcome;

public class Perspective implements IPerspectiveFactory {
	
	public static IPageLayout actualLayout;
	public ApplicationController appController;

	/***
	 * This method sets up the initial layout of the GUI
	 */
	public void createInitialLayout(IPageLayout layout) {
		appController = ApplicationController.instance();
		actualLayout = layout;
		String editorArea = layout.getEditorArea();
		layout.setEditorAreaVisible(false);
		
		/**
		 * 1st parameter: Id of View to add
		 * 2nd parameter: Position on layout
		 * 3rd parameter: Size (???)
		 * 4rd parameter: id of relative (could be view-id)
		 */
		layout.addView(Navigator.ID, IPageLayout.LEFT, 0.25f, editorArea);
		layout.addView(Welcome.ID, IPageLayout.RIGHT, 0.75f, editorArea);
		layout.addView(DeveloperView.ID, IPageLayout.BOTTOM, 0.65f, Navigator.ID);
		
		layout.getViewLayout(Navigator.ID).setCloseable(false);
		layout.getViewLayout(DeveloperView.ID).setCloseable(false);
		layout.getViewLayout(Welcome.ID).setCloseable(false);
	}
}
